import React from 'react';
import './index.less';
import {connect} from "dva";
import BaseComponent from "components/Base/BaseComponent";
import Panel from "components/Base/Panel";
import {Descriptions} from "antd";
import Dlist from "../../../Device/DList/components";
import QList from "../../../Quality/QList/components";


@connect(({hospitalDetail}) => ({hospitalDetail}))
export default class extends BaseComponent {

  getNamespace() {
    return 'hospitalDetail';
  }

  componentDidMount() {
    const {hospitalId} = this.props.match.params;
    this.dispatch({
      type: `${this.getNamespace()}/getHospitalInfo`,
      payload: {
        notice: this.showMsg,
        hospitalId
      },
    })
  }

  render() {
    const {hospitalDetail, match} = this.props;
    const {hospitalId} = match.params;

    const {name, area, city, contact, address, deviceSize} = hospitalDetail.hospitalInfo;

    return (
      <div className="data-detail">
        {/*<h1>{deviceId}设备数据详情</h1>*/}

        <Panel title={`${name}信息`} onRefresh={() => {
        }}>
          <Descriptions bordered>
            <Descriptions.Item label="医院名字">{name}</Descriptions.Item>
            <Descriptions.Item label="区域">{area}</Descriptions.Item>
            <Descriptions.Item label="城市">{city}</Descriptions.Item>
            <Descriptions.Item label="联系人">{contact}</Descriptions.Item>
            <Descriptions.Item label="医院地址">{address}</Descriptions.Item>
            <Descriptions.Item label="设备数量">{deviceSize}</Descriptions.Item>
          </Descriptions>
        </Panel>

        <Panel title="设备列表" onRefresh={() => {
        }}>
          <Dlist/>
        </Panel>

        <Panel title="质控品列表" onRefresh={() => {
        }}>
          <QList/>
        </Panel>

        {/*<Panel title="检验数据" onRefresh={() => {*/}
        {/*}}>*/}
        {/*  <DataValueStatistics hospitalId={hospitalId}/>*/}
        {/*</Panel>*/}

        {/*<Panel title="质控图" onRefresh={() => {*/}
        {/*}}>*/}
        {/*  <QChart hospitalId={hospitalId}/>*/}
        {/*</Panel>*/}

      </div>
    );
  }
}
